

package com.lglbc;

import io.seata.core.context.RootContext;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.jdbc.core.JdbcTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Random;


@RestController
public class AccountController {
	@Autowired
	private AccountMapper accountMapper;
	@PostMapping(value = "/account")
	public String account(String userId, int money) {
		boolean result = accountMapper.update(money,userId);
		return result ? "success" : "failed";
	}

}
